home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1994 #2 / Monster Media No. 2 (Monster Media)(1994).ISO / soundu / dilaudid.zip / SCORE / SCORE.BAS next >
BASIC Source File  |  1993-12-30  |  6KB  |  156 lines

  1. DECLARE SUB drawscreen ()
  2. DECLARE SUB drawloc (scoreloc%)
  3. DECLARE SUB drawcurrent ()
  4. DEFINT A-Z
  5.  
  6. COMMON SHARED startat, score$, currloc, currnote
  7.  
  8. length = 500
  9. DIM SHARED score$(1 TO length, 1 TO 21)
  10.  
  11. CLS
  12. WIDTH , 43
  13.  
  14. startat = 1
  15. currloc = 1
  16. currnote = 0
  17.  
  18. drawscreen
  19.  
  20.  
  21. DO
  22.         drawcurrent
  23.         x$ = ""
  24.         DO UNTIL x$ <> ""
  25.                 x$ = INKEY$
  26.         LOOP
  27.         drawloc currloc
  28.         SELECT CASE x$
  29.                 CASE CHR$(0) + CHR$(72)' ^^^
  30.                         currnote = currnote - 1
  31.                 CASE CHR$(0) + CHR$(80)' vvv
  32.                         currnote = currnote + 1
  33.                 CASE CHR$(0) + CHR$(77)' -->
  34.                         currloc = currloc + 1
  35.                         IF currloc > startat + 75 THEN
  36.                                 startat = startat + 40
  37.                                 drawscreen
  38.                         END IF
  39.                 CASE CHR$(0) + CHR$(75)' <--
  40.                         IF currloc > 1 THEN
  41.                                 currloc = currloc - 1
  42.                                 IF currloc < startat THEN
  43.                                         startat = startat - 40
  44.                                         drawscreen
  45.                                 END IF
  46.                         END IF
  47.                 CASE "-"        'make flat
  48.                         IF NOT (INSTR(a$ + " ", "#")) THEN a$ = a$ + "#"
  49.                 CASE "."        'make longer
  50.                         IF NOT (INSTR(a$ + " ", ".")) THEN a$ = a$ + "."
  51.                 CASE "1"        'whole note            
  52.                         score$(currloc, currnote + 11) = "1" + a$
  53.                         FOR r = 1 TO 15
  54.                                 score$(currloc + r, currnote + 11) = "-"
  55.                                 drawloc currloc + r
  56.                         NEXT
  57.                         a$ = ""
  58.                 CASE "2"        'half note
  59.                         score$(currloc, currnote + 11) = "2" + a$
  60.                         FOR r = 1 TO 7
  61.                                 score$(currloc + r, currnote + 11) = "-"
  62.                                 drawloc currloc + r
  63.                         NEXT
  64.                         IF (INSTR(a$ + " ", ".")) THEN
  65.                                 FOR r = 8 TO 11
  66.                                         score$(currloc + r, currnote + 11) = "-"
  67.                                         drawloc currloc + r
  68.                                 NEXT
  69.                         END IF
  70.                         a$ = ""
  71.                 CASE "4"        'quarter note
  72.                         score$(currloc, currnote + 11) = "4" + a$
  73.                         FOR r = 1 TO 3
  74.                                 score$(currloc + r, currnote + 11) = "-"
  75.                                 drawloc currloc + r
  76.                         NEXT
  77.                         IF (INSTR(a$ + " ", ".")) THEN
  78.                                 score$(currloc + 4, currnote + 11) = "-"
  79.                                 drawloc currloc + 4
  80.                                 score$(currloc + 5, currnote + 11) = "-"
  81.                                 drawloc currloc + 5
  82.                         END IF
  83.                         a$ = ""
  84.                 CASE "8"        'eighth note
  85.                         score$(currloc, currnote + 11) = "8" + a$
  86.                         score$(currloc + 1, currnote + 11) = "-"
  87.                         drawloc currloc + 1
  88.                         IF (INSTR(a$ + " ", ".")) THEN
  89.                                 score$(currloc + 2, currnote + 11) = "-"
  90.                                 drawloc currloc + 2
  91.                         END IF
  92.                         a$ = ""
  93.                 CASE "6"        'sixteenth note
  94.                         score$(currloc, currnote + 11) = "6" + a$
  95.                         a$ = ""
  96.                 CASE "3"        'thirtysecond note
  97.                         score$(currloc, currnote + 11) = "3" + a$
  98.                         a$ = ""
  99.                 CASE " "        'delete note
  100.                         score$(currloc, currnote + 11) = ""
  101.                         a$ = ""
  102.                 CASE "s"
  103.                         OPEN "output.dat" FOR OUTPUT AS #1
  104.                                 FOR r = 1 TO length
  105.                                         FOR t = 1 TO 21
  106.                                                 x$ = score$(r, t)
  107.                                                 IF x$ = "" OR x$ = "-" THEN x$ = " "
  108.                                                 PRINT #1, x$;
  109.                                         NEXT
  110.                                 NEXT
  111.                         CLOSE
  112.                 CASE "q"
  113.                         END
  114.         END SELECT
  115. LOOP
  116.  
  117. SUB drawcurrent
  118.         h = (currloc - startat) + 1
  119.         v = currnote + 15
  120.         LOCATE v, h: COLOR 15: PRINT CHR$(219); : COLOR 7
  121. END SUB
  122.  
  123. SUB drawloc (scoreloc)
  124.         r = (scoreloc - startat) + 1
  125.         h = (scoreloc - startat) + 1
  126.         FOR t = 5 TO 10
  127.                 LOCATE t, h
  128.                 PRINT " ";
  129.         NEXT
  130.         FOR t = 20 TO 25
  131.                 LOCATE t, h
  132.                 PRINT " ";
  133.         NEXT
  134.         FOR t = 2 TO 8 STEP 2
  135.                 LOCATE 10 + t, h
  136.                 PRINT " ";
  137.         NEXT
  138.         FOR t = 1 TO 10 STEP 2
  139.                 LOCATE 10 + t, h
  140.                 PRINT CHR$(196);
  141.         NEXT
  142.         FOR t = 5 TO 24
  143.                 IF score$(scoreloc, t - 4) <> "" THEN
  144.                         LOCATE t, h
  145.                         PRINT score$(scoreloc, t - 4);
  146.                 END IF
  147.         NEXT
  148. END SUB
  149.  
  150. SUB drawscreen
  151.         FOR r = startat TO startat + 79
  152.                 drawloc r
  153.         NEXT
  154. END SUB
  155.  
  156.